package cn.edu.zut.dao;

import cn.edu.zut.domain.Contact;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ContactDao {

    @Select("select * from contact")
    public List<Contact> findAll();

    @Insert("insert into contact(_id,timestamp,senderId,receiverId,mas)" +
            " values(#{_id},#{timestamp},#{senderId},#{receiverId},#{mas})")
    public void insertOne(Contact contact) throws Exception;
}
